/*
 * Copyright (c) 2010. Dylan Schell.
 */

package nl.xs4all.dylanschell.deckprinter.model;

import javax.annotation.Nonnull;
import java.util.UUID;

public class CardInSet
{
    private final UUID id;
    private final UUID setId;
    private final String name;
    private String cost;
    private String convertedManaCost;
    private String color;
    private String type;
    private String subType;
    private String rarity;
    private String rules;
    private String flavor;
    private String power;
    private String toughness;
    private String ptBox;
    private String Artist;
    private String number;
    private String mutiverseId;

    public CardInSet(@Nonnull UUID id, @Nonnull UUID setId, @Nonnull String name)
    {
        this.name = name;
        this.setId = setId;
        this.id = id;
    }

    public CardInSet(@Nonnull CardInSet source)
    {
        this.name = source.name;
        this.id = source.id;
        this.setId = source.setId;
    }

    public UUID getId()
    {
        return id;
    }

    public UUID getSetId()
    {
        return setId;
    }

    public String getName()
    {
        return name;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o)
        {
            return true;
        }
        if (o == null || getClass() != o.getClass())
        {
            return false;
        }

        CardInSet cardInSet = (CardInSet) o;

        if (!id.equals(cardInSet.id))
        {
            return false;
        }
        return name.equals(cardInSet.name) && setId.equals(cardInSet.setId);
    }

    @Override
    public int hashCode()
    {
        int result = id.hashCode();
        result = 31 * result + setId.hashCode();
        result = 31 * result + name.hashCode();
        return result;
    }

    public String getCost()
    {
        return cost;
    }

    public void setCost(String cost)
    {
        this.cost = cost != null ? cost.intern() : null;
    }

    public String getConvertedManaCost()
    {
        return convertedManaCost;
    }

    public void setConvertedManaCost(String convertedManaCost)
    {
        this.convertedManaCost = convertedManaCost != null ? convertedManaCost.intern() : null;
    }

    public String getColor()
    {
        return color;
    }

    public void setColor(String color)
    {
        this.color = color != null ? color.intern() : null;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type != null ? type.intern() : null;
    }

    public String getSubType()
    {
        return subType;
    }

    public void setSubType(String subType)
    {
        this.subType = subType != null ? subType.intern() : null;
    }

    public String getRarity()
    {
        return rarity;
    }

    public void setRarity(String rarity)
    {
        this.rarity = rarity != null ? rarity.intern() : null;
    }

    public String getRules()
    {
        return rules;
    }

    public void setRules(String rules)
    {
        this.rules = rules;
    }

    public String getFlavor()
    {
        return flavor;
    }

    public void setFlavor(String flavor)
    {
        this.flavor = flavor;
    }

    public String getPower()
    {
        return power;
    }

    public void setPower(String power)
    {
        this.power = power != null ? power.intern() : null;
    }

    public String getToughness()
    {
        return toughness;
    }

    public void setToughness(String toughness)
    {
        this.toughness = toughness != null ? toughness.intern() : null;
    }

    public String getPtBox()
    {
        return ptBox;
    }

    public void setPtBox(String ptBox)
    {
        this.ptBox = ptBox != null ? ptBox.intern() : null;
    }

    public String getArtist()
    {
        return Artist;
    }

    public void setArtist(String artist)
    {
        Artist = artist != null ? artist.intern() : null;
    }

    public String getNumber()
    {
        return number;
    }

    public void setNumber(String number)
    {
        this.number = number != null ? number.intern() : null;
    }

    public String getMutiverseId()
    {
        return mutiverseId;
    }

    public void setMutiverseId(String mutiverseId)
    {
        this.mutiverseId = mutiverseId;
    }
}
